


#include "cTypes.h"

#ifdef __cplusplus
extern "C" {
#endif


void COMMON_INIT();

#ifdef _TI_

int	 TI_ENCODER_MEMORY_SIZE(int W, int H);
int	 TI_DECODER_MEMORY_SIZE(int W, int H);
void TI_ENCODER_MEMORY_INIT(BYTE *Memory, int W, int H);
void TI_DECODER_MEMORY_INIT(BYTE *Memory, int W, int H);

#else
BYTE *INIT_ENCODER(int W, int H);
BYTE *INIT_DECODER(int W, int H);
void FREE_ENCODER(void *Memory);
void FREE_DECODER(void *Memory);

#endif


int COMPRESS_FRAME(BYTE *Ybuf, BYTE *Ubuf, BYTE* Vbuf, int W, int H, BYTE *Pool, int PkSize, 
				   int DontRestoreLevel0, BYTE *Memory);

void DECOMPRESS_FRAME(BYTE *Ybuf, BYTE *Ubuf, BYTE *Vbuf, int W, int H, BYTE *Pool, BYTE *Memory);
void DECOMPRESS_QUART_FRAME(BYTE *Ybuf, BYTE *Ubuf, BYTE *Vbuf, int W, int H, BYTE *Pool, BYTE *Memory, int PoolLen);


void Write_Filter_Param(int Param, int Index, BYTE *Memory);
int Read_Filter_Param(int Index, BYTE *Memory);
void Write_Filter_Mask(unsigned int Mask, BYTE *Memory);
unsigned int Read_Filter_Mask(BYTE *Memory);





#ifdef _MMX_

void INTEL_P_Filter(BYTE *buf, int W, int H, int CenterScale);
void INTEL_Extrem_Filter_MinMax(BYTE *buf, int W, int H);
void INTEL_Extrem_Filter_Aver(BYTE *buf, int W, int H, int Max_Min);


void INTEL_PutDelta_BaseX(BYTE *Dest, BYTE *Top, BYTE *Center, BYTE *Bottom, int W, 
								short *Quant, short *Rest_Delta, short *Prob, char *Delta, int *NewIndex);

void INTEL_PutDelta_BaseX_MinProb(BYTE *Dest, BYTE *Top, BYTE *Center, BYTE *Bottom, int W, 
								short *Quant, short *Rest_Delta, short *Prob, char *Delta, int MinProb, 
								int *Delta_Pnt, int *NewIndex);



void INTEL_PutDelta_BaseY(BYTE *Dest, BYTE *Sorc, BYTE *Top, BYTE *Bottom, int W, 
								short *Quant, short *Rest_Delta, short *Prob, char *Delta, int *NewIndex);

void INTEL_PutDelta_BaseY_MinProb(BYTE *Dest, BYTE *Sorc, BYTE *Top, BYTE *Bottom, int W, 
								short *Quant, short *Rest_Delta, short *Prob, char *Delta, int MinProb, 
								int *Delta_Pnt, int *NewIndex);




void INTEL_SetProb_BaseX(BYTE *Dest, BYTE *Top, BYTE *Center, BYTE *Bottom, int W, short *Prob, int *NewIndex);

void INTEL_SetProb_BaseX_MinProb(BYTE *Dest, BYTE *Top, BYTE *Center, BYTE *Bottom, int W, 
								 short *Prob, int *ProbLocation, int MinProb, int *Delta_Pnt, int Prob_Pnt, int *NewIndex);



void INTEL_SetProb_BaseY(BYTE *Top, BYTE *Bottom, int W, short *Prob, int *NewIndex);

void INTEL_SetProb_BaseY_MinProb(BYTE *Top, BYTE *Bottom, int W, 
								 short *Prob, int *ProbLocation, int MinProb, int *Delta_Pnt, int Prob_Pnt, int *NewIndex);



void INTEL_Aver_Line(BYTE *Dest, BYTE *Top, BYTE *Bottom, int W); 



#endif



#ifdef __cplusplus
}
#endif




